﻿@model IEnumerable<WeProjectsModel.Notice>

@{
    ViewBag.Title = "Index";
}

<h2>通知列表</h2>
@if (Roles.IsUserInRole("sysadmin"))
{
    <p class="buttonIn">
        @Html.ActionLink("发布通知", "Create")
    </p>}
<table class="table">
    <tr>
        <th>
            标题
        </th>
        @*<th>
            @Html.DisplayNameFor(model => model.NoticeContent)
        </th>*@
        <th>
            发布时间
        </th>
        <th>操作</th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.ActionLink(item.Title, "Details", new {id=item.ID })
        </td>
        @*<td>
            @Html.DisplayFor(modelItem => item.NoticeContent)
        </td>*@
        <td>
            @Html.DisplayFor(modelItem => item.PublishDate)
        </td>
        <td>
            @if (Roles.IsUserInRole("sysadmin")) { 
            @Html.ActionLink("编辑", "Edit", new { id = item.ID }, new { @class = "btn btn-success btn-small" })<span>&nbsp;</span>
            @Html.ActionLink("删除", "Delete", new { id = item.ID }, new { @class = "btn btn-danger btn-small" })
            }
        </td>
    </tr>
}

</table>
